<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="https://www.wulihub.com.cn/gc/Wez0VG/images/apple-touch-icon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="https://www.wulihub.com.cn/gc/Wez0VG/images/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="https://www.wulihub.com.cn/gc/Wez0VG/images/favicon-16x16.png">
  <link rel="mask-icon" href="https://www.wulihub.com.cn/gc/Wez0VG/images/logo.svg" color="#222">

<link rel="stylesheet" href="https://www.wulihub.com.cn/gc/Wez0VG/css/main.css">



<link rel="stylesheet" href="https://npm.elemecdn.com/@fortawesome/fontawesome-free@6.1.1/css/all.min.css" integrity="sha256-DfWjNxDkM94fVBWx1H5BMMp0Zq7luBlV8QRcSES7s+0=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://npm.elemecdn.com/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"nobige.cn","root":"/","images":"https://www.wulihub.com.cn/gc/Wez0VG/images","scheme":"Gemini","darkmode":false,"version":"8.12.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/config.js"></script>

    <meta name="description" content="其实 原理同《coding持续集成部署hexo博客》相似，只是换了个平台而已，仅此而已。但是可以配合使用Github的话可以使用jsdelivr CDN（中国由网宿cdn提供）  使用 GitHub Actions同Travis CI差不多都是持续集成服务，感兴趣可以到官网了解 Features • GitHub Actions  由于是自家的服务，所以每个项目都是内置自带Actions的，需要使">
<meta property="og:type" content="article">
<meta property="og:title" content="GitHub_Actions部署Hexo博客">
<meta property="og:url" content="https://nobige.cn/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/index.html">
<meta property="og:site_name" content="NoBige-JackCh3n">
<meta property="og:description" content="其实 原理同《coding持续集成部署hexo博客》相似，只是换了个平台而已，仅此而已。但是可以配合使用Github的话可以使用jsdelivr CDN（中国由网宿cdn提供）  使用 GitHub Actions同Travis CI差不多都是持续集成服务，感兴趣可以到官网了解 Features • GitHub Actions  由于是自家的服务，所以每个项目都是内置自带Actions的，需要使">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_21_23_58.png">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_22_29_26.png">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_22_30_37.png">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_21_28_28.png">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_22_01_19.png">
<meta property="article:published_time" content="2020-05-20T14:04:26.000Z">
<meta property="article:modified_time" content="2024-11-07T02:59:06.306Z">
<meta property="article:author" content="JackCh3n">
<meta property="article:tag" content="github">
<meta property="article:tag" content="hexo">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_21_23_58.png">


<link rel="canonical" href="https://nobige.cn/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"en","comments":true,"permalink":"https://nobige.cn/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/","path":"post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/","title":"GitHub_Actions部署Hexo博客"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>GitHub_Actions部署Hexo博客 | NoBige-JackCh3n</title>
  
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-122817633-1","only_pageview":true}</script>
  <script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/analytics/google-analytics.js"></script>

  <script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/analytics/baidu-analytics.js"></script>
  <script async src="https://hm.baidu.com/hm.js?96741f92c07d010c0ddd1d02197893e2"></script>




  <noscript>
    <link rel="stylesheet" href="https://www.wulihub.com.cn/gc/Wez0VG/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">NoBige-JackCh3n</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">copy to my blog</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="home fa-fw"></i>Home</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="user fa-fw"></i>About</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="tags fa-fw"></i>Tags</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="th fa-fw"></i>Categories</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="archive fa-fw"></i>Archives</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="sitemap fa-fw"></i>Sitemap</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>Search
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="Searching..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%85%B6%E5%AE%9E"><span class="nav-number">1.</span> <span class="nav-text">其实</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BD%BF%E7%94%A8"><span class="nav-number">2.</span> <span class="nav-text">使用</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jsdelivr"><span class="nav-number">3.</span> <span class="nav-text">jsdelivr</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8F%82%E8%80%83"><span class="nav-number">4.</span> <span class="nav-text">参考</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="JackCh3n"
      src="https://www.wulihub.com.cn/gc/Wez0VG/images/avatar.png">
  <p class="site-author-name" itemprop="name">JackCh3n</p>
  <div class="site-description" itemprop="description">Record the pit filling process with words</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">146</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">279</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/jackch3n" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;jackch3n" rel="noopener" target="_blank"><i class="github fa-fw"></i>GitHub</a>
      </span>
  </div>


  <div class="links-of-blogroll site-overview-item animated">
    <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://vercel.com/?f=nobige" title="https:&#x2F;&#x2F;vercel.com?f&#x3D;nobige" rel="noopener" target="_blank">vercel</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.jsdelivr.com/?f=nobige" title="https:&#x2F;&#x2F;www.jsdelivr.com?f&#x3D;nobige" rel="noopener" target="_blank">jsdelivr</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.upyun.com/?f=nobige" title="https:&#x2F;&#x2F;www.upyun.com?f&#x3D;nobige" rel="noopener" target="_blank">upyun</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://coding.net/?f=nobige" title="https:&#x2F;&#x2F;coding.net?f&#x3D;nobige" rel="noopener" target="_blank">coding</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://unsplash.com/?f=nobige" title="https:&#x2F;&#x2F;unsplash.com?f&#x3D;nobige" rel="noopener" target="_blank">unsplash</a>
        </li>
    </ul>
  </div>

        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="https://nobige.cn/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://www.wulihub.com.cn/gc/Wez0VG/images/avatar.png">
      <meta itemprop="name" content="JackCh3n">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="NoBige-JackCh3n">
      <meta itemprop="description" content="Record the pit filling process with words">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="GitHub_Actions部署Hexo博客 | NoBige-JackCh3n">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          GitHub_Actions部署Hexo博客
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2020-05-20 22:04:26" itemprop="dateCreated datePublished" datetime="2020-05-20T22:04:26+08:00">2020-05-20</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2024-11-07 10:59:06" itemprop="dateModified" datetime="2024-11-07T10:59:06+08:00">2024-11-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E6%8A%80%E5%B7%A7/" itemprop="url" rel="index"><span itemprop="name">技巧</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="Views" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">Views: </span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h2 id="其实"><a href="#其实" class="headerlink" title="其实"></a>其实</h2><blockquote>
<p>原理同《<a href="https://nobige.cn/post/20191007-coding_chi_xu_ji_cheng_bu_shu_hexo_bo_ke/">coding持续集成部署hexo博客</a>》相似，只是换了个平台而已，仅此而已。但是可以配合使用Github的话可以使用jsdelivr CDN（中国由网宿cdn提供）</p>
</blockquote>
<h2 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h2><blockquote>
<p>GitHub Actions同Travis CI差不多都是持续集成服务，感兴趣可以到官网了解 <a target="_blank" rel="noopener" href="https://github.com/features/actions">Features • GitHub Actions</a></p>
</blockquote>
<p>由于是自家的服务，所以每个项目都是内置自带Actions的，需要使用只需在项目页面的Actions子页面，选择你要的脚本或是使用自己的脚本，这里选择<strong>set up a workflow yourself</strong> </p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_21_23_58.png" alt="Actions"></p>
<p>之后只要复制以下代码即可(代码来自@JerryC)</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">name:</span> <span class="string">自动部署</span> <span class="string">Hexo</span></span><br><span class="line"></span><br><span class="line"><span class="attr">on:</span></span><br><span class="line">  <span class="attr">push:</span></span><br><span class="line">    <span class="attr">branches:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="string">master</span></span><br><span class="line"></span><br><span class="line"><span class="attr">jobs:</span></span><br><span class="line">  <span class="attr">build:</span></span><br><span class="line">    <span class="attr">runs-on:</span> <span class="string">ubuntu-latest</span></span><br><span class="line">    <span class="attr">strategy:</span></span><br><span class="line">      <span class="attr">matrix:</span></span><br><span class="line">        <span class="attr">node-version:</span> [<span class="number">10.</span><span class="string">x</span>]</span><br><span class="line"></span><br><span class="line">    <span class="attr">steps:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">开始运行</span></span><br><span class="line">        <span class="attr">uses:</span> <span class="string">actions/checkout@v1</span></span><br><span class="line"></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">设置</span> <span class="string">Node.js</span> <span class="string">$&#123;&#123;</span> <span class="string">matrix.node-version</span> <span class="string">&#125;&#125;</span></span><br><span class="line">        <span class="attr">uses:</span> <span class="string">actions/setup-node@v1</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">node-version:</span> <span class="string">$&#123;&#123;</span> <span class="string">matrix.node-version</span> <span class="string">&#125;&#125;</span></span><br><span class="line"></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">安装</span> <span class="string">Hexo</span> <span class="string">CI</span></span><br><span class="line">        <span class="attr">run:</span> <span class="string">|</span></span><br><span class="line"><span class="string">          export TZ=&#x27;Asia/Shanghai&#x27;</span></span><br><span class="line"><span class="string">          npm install hexo-cli -g</span></span><br><span class="line"><span class="string"></span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">缓存</span></span><br><span class="line">        <span class="attr">uses:</span> <span class="string">actions/cache@v1</span></span><br><span class="line">        <span class="attr">id:</span> <span class="string">cache-dependencies</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">path:</span> <span class="string">node_modules</span></span><br><span class="line">          <span class="attr">key:</span> <span class="string">$&#123;&#123;runner.OS&#125;&#125;-$&#123;&#123;hashFiles(&#x27;**/package-lock.json&#x27;)&#125;&#125;</span></span><br><span class="line"></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">安装插件</span></span><br><span class="line">        <span class="attr">if:</span> <span class="string">steps.cache-dependencies.outputs.cache-hit</span> <span class="type">!=</span> <span class="string">&#x27;true&#x27;</span></span><br><span class="line">        <span class="attr">run:</span> <span class="string">|</span></span><br><span class="line"><span class="string">          npm install</span></span><br><span class="line"><span class="string"></span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">部署博客</span></span><br><span class="line">        <span class="attr">run:</span> <span class="string">|</span></span><br><span class="line"><span class="string">          hexo clean &amp;&amp; hexo g </span></span><br><span class="line"><span class="string">          cd ./public</span></span><br><span class="line"><span class="string">          git init</span></span><br><span class="line"><span class="string">          git config user.name &quot;$&#123;&#123;secrets.GIT_NAME&#125;&#125;&quot;</span></span><br><span class="line"><span class="string">          git config user.email &quot;$&#123;&#123;secrets.GIT_EMAIL&#125;&#125;&quot;</span></span><br><span class="line"><span class="string">          git add .</span></span><br><span class="line"><span class="string">          git commit -m &quot;Update&quot;</span></span><br><span class="line"><span class="string">          git push --force --quiet &quot;https://$&#123;&#123;secrets.GH_TOKEN&#125;&#125;@$&#123;&#123;secrets.GH_REF&#125;&#125;&quot; master:master</span></span><br></pre></td></tr></table></figure>

<p>需要关注的就是4个变量和1个执行命令</p>
<p>变量：GIT_NAME，GIT_EMAIL，GH_TOKEN，GH_REF，分别是git的姓名，邮箱和token及仓库地址</p>
<p>token获取地址，Settings——Developer settings——Personal access tokens——Generate new token创建一个只有public_repo（公共仓库）权限的token即可，得到一个类似<code>d6ce252bf70f925f32c36850a14e276b915b005f</code></p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_22_29_26.png" alt="create token"></p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_22_30_37.png" alt="token"></p>
<p>仓库地址为：<code>github.com/JackCh3n/n0bige.git</code></p>
<p>这一句完整的命令就是使用Token强制提交</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push --force --quiet https://d6ce252bf70f925f32c36850a14e276b915b005f@github.com/JackCh3n/n0bige.git master:master</span><br></pre></td></tr></table></figure>

<p>变量则是在项目，settings，Secrets，创建并添加即可，之后脚本就可以通过<code>$&#123;&#123;secrets.GIT_NAME&#125;&#125;</code>的方式获取变量的值了，为了保护隐私&#x2F;安全？</p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_21_28_28.png" alt="Secrets"></p>
<p>执行命令：原来是<code>hexo clean &amp;&amp; hexo g &amp;&amp; hexo douban &amp;&amp; gulp</code>，就是hexo缓存清理，hexo生成静态文件，hexo 豆瓣页面和html，css，js压缩，这里可以根据自己的需求做修改，如我就将最后的两个都删了,最终得到<code>hexo clean &amp;&amp; hexo g</code> </p>
<p>最后可以在项目页—— Actions——All workflows查看脚本运行的日志和情况</p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200520-GitHub_Actions_bu_shu_H_e_x_o_bo_ke/fuckqq_2020_05-20_22_01_19.png" alt="脚本日志"></p>
<h2 id="jsdelivr"><a href="#jsdelivr" class="headerlink" title="jsdelivr"></a>jsdelivr</h2><blockquote>
<p>一个开放的CDN，提供npm，GitHub，WordPress等项目的镜像功能（国内用的是网宿CDN）</p>
</blockquote>
<p>使用方法copy官方的介绍，支持版本号、分支、列表或是获取精简版的js和css</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">//加载任何GitHub版本、提交或分支</span><br><span class="line">//注意：我们建议对支持npm的项目使用npm</span><br><span class="line">https://cdn.jsdeliver.net/gh/user/repo@version/file</span><br><span class="line"></span><br><span class="line">//加载jQuery v3.2.1</span><br><span class="line">https://cdn.jsdeliver.net/gh/jquery/jquery@3.2.1/dist/jquery.min.js</span><br><span class="line"></span><br><span class="line">//使用版本范围而不是特定版本</span><br><span class="line">https://cdn.jsdeliver.net/gh/jquery/jquery@3.2/dist/jquery.min.js</span><br><span class="line">https://cdn.jsdeliver.net/gh/jquery/jquery@3/dist/jquery.min.js</span><br><span class="line"></span><br><span class="line">//完全省略版本以获得最新版本</span><br><span class="line">//你不应该在生产中使用这个</span><br><span class="line">https://cdn.jsdeliver.net/gh/jquery/jquery/dist/jquery.min.js</span><br><span class="line"></span><br><span class="line">//将“.min”添加到任何JS/CSS文件以获取精简版本</span><br><span class="line">//如果不存在，我们会为您生成</span><br><span class="line">https://cdn.jsdeliver.net/gh/jquery/jquery@3.2.1/src/core.min.js</span><br><span class="line"></span><br><span class="line">//在末尾添加/以获取目录列表</span><br><span class="line">https://cdn.jsdeliver.net/gh/jquery/jquery/</span><br></pre></td></tr></table></figure>

<p>注意：jsdelivr 仅支持20M以下的文件加速，20M以上会出现无法下载的现象。</p>
<blockquote>
<p>仓库超过50M也无法显示列表：Package size exceeded the configured limit of 50 MB. Try <a target="_blank" rel="noopener" href="https://github.com/JackCh3n/pantest/tree/master/">https://github.com/JackCh3n/pantest/tree/master/</a> instead.</p>
<p>单文件大小超过20M：File size exceeded the configured limit of 20 MB.</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">jsdelivr CDN文件上限测下载链接</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/1m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/10m.zip</span><br><span class="line"></span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/20m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/21m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/22m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/23m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/24m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/25m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/26m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/27m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/28m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/29m.zip</span><br><span class="line"></span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/30m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/40m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/50m.zip</span><br><span class="line">https://cdn.jsdelivr.net/gh/JackCh3n/pantest/55m.zip</span><br><span class="line">window生成指定大小文件</span><br><span class="line">fsutil file createnew c:\1 1024</span><br><span class="line"># 1024 = 1k</span><br><span class="line"># 10240 = 10k</span><br><span class="line"># 1024000 = 1mb</span><br><span class="line"># 10240000 = 10mb</span><br><span class="line"># 20480000 = 20mb</span><br><span class="line"># 25600000 = 25mb</span><br><span class="line"># 30720000 = 30mb</span><br><span class="line"># 40960000 = 40mb</span><br><span class="line"># 51200000 = 50mb</span><br><span class="line"># 56320000 = 55mb</span><br><span class="line"></span><br><span class="line">linux生成指定大小文件</span><br><span class="line"># /dev/zero 是 Linux 提供的一个特殊的字符设备（伪文件，Pseudo-devices）</span><br><span class="line"># 它的特点是可以永远读该文件，每次读取的结果都是二进制 0</span><br><span class="line">#生成一个文件名为10M.zip的10M测试文件</span><br><span class="line">dd if=/dev/zero of=/root/test/10M.zip bs=1M count=10</span><br></pre></td></tr></table></figure>

<h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><ul>
<li><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/103618527">@Jerry - travisci&#x2F;GitHub Actions部署GitHub Pages和Coding Pages - 知乎</a></li>
</ul>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/github/" rel="tag"># github</a>
              <a href="/tags/hexo/" rel="tag"># hexo</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/20200505-rclone_gua_zai_GoogleDrive/" rel="prev" title="rclone挂载GoogleDrive">
                  <i class="fa fa-chevron-left"></i> rclone挂载GoogleDrive
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/20200727-Java_cuo_wu_ji_he/" rel="next" title="Java错误集合">
                  Java错误集合 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    
  <div class="comments" id="disqus_thread">
    <noscript>Please enable JavaScript to view the comments powered by Disqus.</noscript>
  </div>
  
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">JackCh3n</span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" rel="noopener" target="_blank">NexT.Gemini</a>
  </div>
    <br/>Powerful CDN service provided by 
  <a target="_blank" rel="noopener" href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" style="border:none"><img src="https://www.wulihub.com.cn/gc/Wez0VG/images/upyun_logo.png" height="66" style="display: list-item;" alt="upyun"></a> 
  <a target="_blank" rel="noopener" href="https://www.jsdelivr.com" style="border:none"><img src="https://www.wulihub.com.cn/gc/Wez0VG/images/jsdelivr_logo.svg" height="50" style="display: list-item;" alt="JsDelivr"></a>
  <p>
  <br/><a target="_blank" rel="noopener" href="https://pages.github.com/?f=nobige">Github Pages</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://vercel.com/?f=nobige">Vercel</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://www.netlify.com/?f=nobige">Netlify</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://coding.net/?f=nobige">coding</a>&nbsp;&nbsp;provides static publishing
  </p>

    </div>
  </footer>

  
  <script src="https://npm.elemecdn.com/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/comments.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/utils.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/motion.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/next-boot.js"></script>

  
<script src="https://npm.elemecdn.com/hexo-generator-searchdb@1.4.0/dist/search.js" integrity="sha256-vXZMYLEqsROAXkEw93GGIvaB2ab+QW6w3+1ahD9nXXA=" crossorigin="anonymous"></script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/search/local-search.js"></script>





  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




<link rel="stylesheet" href="https://npm.elemecdn.com/disqusjs@1.3.0/dist/disqusjs.css" integrity="sha256-GxdCIOyfxQ1OBfS99qAIJDoGK1ADuBsxhMTqXG82fAY=" crossorigin="anonymous">

<script class="next-config" data-name="disqusjs" type="application/json">{"enable":true,"api":"https://duosuo.nobige.cn/","apikey":"Kmo9kPwsir7ppp8tGpeGROCmUtW8tdZBOdBVowPC67xVfTS5uV1wr6s4kckvP95m","shortname":"nobige","js":{"url":"https://npm.elemecdn.com/disqusjs@1.3.0/dist/disqus.js","integrity":"sha256-LVaMHPQ2zLqOc5rXSAfr4d1PIkEGNLyyUTDNPZmTtUw="}}</script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/comments/disqusjs.js"></script>

</body>
</html>
